import App from '../App.vue'
// const login = r => require.ensure([], () => r(require('../page/login/login')), 'login')
// const Tabbar = r => require.ensure([], () => r(require('../components/common/tabbar')), 'tabbar')
// const home = r => require.ensure([], () => r(require('../page/home/home')), 'home')
// const register = r => require.ensure([], () => r(require('../page/login/register')), 'register')
// const my = r => require.ensure([], () => r(require('../page/my/my')), 'my')
import my from '@/page/my/my.vue'
import login from '@/page/login/login.vue'
import home from '@/page/home/home.vue'
import Tabbar from '@/components/common/tabbar.vue'
import register from '@/page/login/register.vue'
import userEdit from '@/page/my/children/userEdit.vue'
import news from '@/page/news/news.vue'
import video from '@/page/video/video.vue'
// import articles from '@/page/home/children/articles.vue'
import article from '@/page/home/children/children/children/article.vue'
import search from '@/page/search/search.vue'
export default [{
    path: '/',
    component: App,
    children: [{
            path: '/',
            name: 'tabBar',
            component: Tabbar,
            children: [{
                    path: '',
                    name: 'home',
                    component: home, // 主页
                },
                {
                    path: '/my',
                    name: 'my',
                    component: my // 个人中心
                },
                {
                    path: '/login',
                    name: 'login',
                    component: login,
                },
                {
                    path: '/register',
                    component: register, // 注册页面
                },
                {
                    path: '/news',
                    component: news, // 问答页面
                },
                {
                    path: '/video',
                    component: video, // 视频页面
                }
            ]
        },
        {
            path: '/userEdit',
            component: userEdit, // 用户信息编辑页面
        },
        // {
        //     path: '/articles/:articleId', // 设置动态路由
        //     component: articles, // 新闻推荐组件
        //     props: true, // 动态组件的参数传给子路由
        // },
        {
            path: '/search',
            component: search, // 搜索页面
        },
        {
            path: '/article/:articleId',
            component: article,
            props: true,
        }
    ]
}, ]
